import java.util.ArrayList;
import java.util.List;

public class Folder extends AbstractFile{
    List<AbstractFile> children = new ArrayList<AbstractFile>();
    @Override
    public boolean add(AbstractFile file) {
        boolean flag = false;
        flag = children.add(file);
        return flag;
    }

    @Override
    public boolean remove(AbstractFile file) {
        boolean flag = false;
        flag = children.remove(file);
        return flag;
    }

    @Override
    public AbstractFile getChild(int i) {
        return children.get(i);
    }

    @Override
    public void KillVirus() {
        System.out.println("**********************************************");
        System.out.println("检测到文件夹,向文件夹内部杀毒中...");
        for (AbstractFile file : children) {
            file.KillVirus();
        }
        System.out.println("**********************************************");
    }
}
